package com.gxa.xly2024.controller;

import com.gxa.xly2024.pojo.Purchase;
import com.gxa.xly2024.pojo.Supplier;
import com.gxa.xly2024.service.impl.PurchaseServiceImpl;
import com.gxa.xly2024.service.impl.SupplierServiceImpl;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/supplier")
public class SupplierController {

    @Resource
    private SupplierServiceImpl supplierService;

    @GetMapping("/selectSupplier")
    public Map<String, Object> selectSupplier() {
        return this.supplierService.selectSupplier();
    }

    @PostMapping("/insert_Supplier")
    public Map<String, Object> insert(@RequestBody Supplier supplier) {   // 接收前端传递的json对象
        return this.supplierService.insert(supplier);
    }

    @PostMapping("/updateById_Supplier")
    public Map<String, Object> updateById(@RequestBody Supplier supplier) {   // 接收前端传递的json对象
        return this.supplierService.updateById(supplier);
    }
    @PostMapping("/deleteById_Supplier")
    public Map<String, Object> deleteById(Integer id) {   // 接收前端传递的json对象
        return this.supplierService.deleteById(id);
    }
}
